package cn.exrick.xboot.base.entity

import cn.exrick.xboot.core.base.XbootBaseEntity
import cn.exrick.xboot.core.base.XbootBaseEntityKt
import cn.exrick.xboot.core.common.utils.SnowFlakeUtil
import com.baomidou.mybatisplus.annotation.TableId
import com.baomidou.mybatisplus.annotation.TableName
import com.fasterxml.jackson.annotation.JsonFormat
import io.swagger.annotations.ApiModel
import io.swagger.annotations.ApiModelProperty
import org.hibernate.annotations.DynamicInsert
import org.hibernate.annotations.DynamicUpdate
import org.springframework.format.annotation.DateTimeFormat
import java.util.*
import javax.persistence.Entity
import javax.persistence.Id
import javax.persistence.Table

/**
 * @author Fei
 */
@Entity
@DynamicInsert
@DynamicUpdate
@Table(name = "en_employee_official_exam_record")
@TableName("en_employee_official_exam_record")
@ApiModel(value = "员工正式考试信息记录表")
data class EmployeeOfficialExamRecord(

        @ApiModelProperty("企业id")
        var enterpriseId: String? = null,


        @ApiModelProperty("员工id")
        var employeeUserId: String? = null,

        @ApiModelProperty("岗位培训id")
        var jobTrainId: String? = null,

        @ApiModelProperty("岗位培训分支id")
        var jobTrainPartId: String? = null,

        @ApiModelProperty("考试完成时间")
        @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
        @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        var examCompleteTime: Date? = Date(),

        @ApiModelProperty("监管部门考试监督员id")
        var supervisionUserId: String? = null,

        @ApiModelProperty("考试自拍照")
        var examSelfPic: String? = null,

        @ApiModelProperty("考场id")
        var examRoomId: String? = null
) : XbootBaseEntityKt() {

    @Id
    @TableId
    override var id: String = SnowFlakeUtil.nextId().toString()

    companion object{
        private const val serialVersionUID = 1L
    }
}
